import yaml
from tools.utils import loc_collection
import datetime


if __name__ == "__main__":
    with open("../config.yaml", 'r', encoding='utf-8') as f:
        cfg = yaml.load(f.read(), yaml.FullLoader)
    coll = loc_collection('project_config', 'commodity')
    cfg['today'] = str(datetime.date.today())[:10]
    del cfg['_id']
    coll.insert_many([cfg])